\hypertarget{group__adc__api}{
\section{Adc\_\-api}
\label{group__adc__api}\index{Adc\_\-api@{Adc\_\-api}}
}
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__adc__api_gaf3f24a91c845be4d568771d22b1a1fdb}{
\#define {\bfseries ADC\_\-SEQ}~(ADC\_\-O\_\-SSMUX0)}
\label{group__adc__api_gaf3f24a91c845be4d568771d22b1a1fdb}

\item 
\hypertarget{group__adc__api_ga6bf20ca12f40b48fe847932afbe2c417}{
\#define {\bfseries ADC\_\-SEQ\_\-STEP}~(ADC\_\-O\_\-SSMUX1 -\/ ADC\_\-O\_\-SSMUX0)}
\label{group__adc__api_ga6bf20ca12f40b48fe847932afbe2c417}

\item 
\hypertarget{group__adc__api_ga7d06bdf27ba8b99129350b07dcf2694c}{
\#define {\bfseries ADC\_\-SSMUX}~(ADC\_\-O\_\-SSMUX0 -\/ ADC\_\-O\_\-SSMUX0)}
\label{group__adc__api_ga7d06bdf27ba8b99129350b07dcf2694c}

\item 
\hypertarget{group__adc__api_ga9cc94e756a2141847edd28f2c8858ffa}{
\#define {\bfseries ADC\_\-SSCTL}~(ADC\_\-O\_\-SSCTL0 -\/ ADC\_\-O\_\-SSMUX0)}
\label{group__adc__api_ga9cc94e756a2141847edd28f2c8858ffa}

\item 
\hypertarget{group__adc__api_ga81c641a3a818165db8055e9339113d20}{
\#define {\bfseries ADC\_\-SSFIFO}~(ADC\_\-O\_\-SSFIFO0 -\/ ADC\_\-O\_\-SSMUX0)}
\label{group__adc__api_ga81c641a3a818165db8055e9339113d20}

\item 
\hypertarget{group__adc__api_ga3729a10252cbb3489d9672e306cf2ad5}{
\#define {\bfseries ADC\_\-SSFSTAT}~(ADC\_\-O\_\-SSFSTAT0 -\/ ADC\_\-O\_\-SSMUX0)}
\label{group__adc__api_ga3729a10252cbb3489d9672e306cf2ad5}

\item 
\hypertarget{group__adc__api_ga2834172319e2ab27bfb106236f94fccb}{
\#define {\bfseries ADC\_\-SSOP}~(ADC\_\-O\_\-SSOP0 -\/ ADC\_\-O\_\-SSMUX0)}
\label{group__adc__api_ga2834172319e2ab27bfb106236f94fccb}

\item 
\hypertarget{group__adc__api_gae2c07f95552cf4ce651adbda11235aa6}{
\#define {\bfseries ADC\_\-SSDC}~(ADC\_\-O\_\-SSDC0 -\/ ADC\_\-O\_\-SSMUX0)}
\label{group__adc__api_gae2c07f95552cf4ce651adbda11235aa6}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{group__adc__api_ga90b697e93737637b18ca17ba315d0960}{ADCIntRegister} (unsigned long ulBase, unsigned long ulSequenceNum, void($\ast$pfnHandler)(void))
\item 
void \hyperlink{group__adc__api_ga0130fdd06a388f91d68b42e98599405c}{ADCIntUnregister} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
void \hyperlink{group__adc__api_gabbafafc5d13dab892fc2f09c2b366c08}{ADCIntDisable} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
void \hyperlink{group__adc__api_ga983b3c3086985150a5498df181c3d3c6}{ADCIntEnable} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
unsigned long \hyperlink{group__adc__api_ga3900a49a9497d231648740508481c92c}{ADCIntStatus} (unsigned long ulBase, unsigned long ulSequenceNum, tBoolean bMasked)
\item 
void \hyperlink{group__adc__api_gae80ad35fe9d9e4119df22142e2ddeab1}{ADCIntClear} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
void \hyperlink{group__adc__api_ga79b1adfafb8f25fc88613156ab1ef9ae}{ADCSequenceEnable} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
void \hyperlink{group__adc__api_ga87047180c884c67e38fc95c9f0e5bdb6}{ADCSequenceDisable} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
void \hyperlink{group__adc__api_ga66699c796f6252a31113a01ef56ddcd7}{ADCSequenceConfigure} (unsigned long ulBase, unsigned long ulSequenceNum, unsigned long ulTrigger, unsigned long ulPriority)
\item 
void \hyperlink{group__adc__api_ga4255381a49e2767945734a15adb700ce}{ADCSequenceStepConfigure} (unsigned long ulBase, unsigned long ulSequenceNum, unsigned long ulStep, unsigned long ulConfig)
\item 
long \hyperlink{group__adc__api_ga8b785e96d8b5adecf41a90f3bff38f1b}{ADCSequenceOverflow} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
void \hyperlink{group__adc__api_ga83f78e68fc287cf7c36a171c54389ef6}{ADCSequenceOverflowClear} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
long \hyperlink{group__adc__api_ga5a2c01642708999b5008bce9fb21d0d5}{ADCSequenceUnderflow} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
void \hyperlink{group__adc__api_gab1fe3dc72fdfc14c10e611c938b8ae6c}{ADCSequenceUnderflowClear} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
long \hyperlink{group__adc__api_ga6e0219d881315c4b39e5686f40aa0db7}{ADCSequenceDataGet} (unsigned long ulBase, unsigned long ulSequenceNum, unsigned long $\ast$pulBuffer)
\item 
void \hyperlink{group__adc__api_gad967d1980e0f58c59dd8a150737e7bef}{ADCProcessorTrigger} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
void \hyperlink{group__adc__api_gaa637ac7dcf88b706e7a8a0a8c33fa32c}{ADCSoftwareOversampleConfigure} (unsigned long ulBase, unsigned long ulSequenceNum, unsigned long ulFactor)
\item 
void \hyperlink{group__adc__api_ga6d0d2422800b86bae349a98913d9834b}{ADCSoftwareOversampleStepConfigure} (unsigned long ulBase, unsigned long ulSequenceNum, unsigned long ulStep, unsigned long ulConfig)
\item 
void \hyperlink{group__adc__api_gaebfb19a94337c291be9e88f7fbfb36a7}{ADCSoftwareOversampleDataGet} (unsigned long ulBase, unsigned long ulSequenceNum, unsigned long $\ast$pulBuffer, unsigned long ulCount)
\item 
void \hyperlink{group__adc__api_gafbe28f42c1d53ca93d1d78dabdce3511}{ADCHardwareOversampleConfigure} (unsigned long ulBase, unsigned long ulFactor)
\item 
void \hyperlink{group__adc__api_ga1864354227236229a298d604ed7793c0}{ADCComparatorConfigure} (unsigned long ulBase, unsigned long ulComp, unsigned long ulConfig)
\item 
void \hyperlink{group__adc__api_gab175455ea8292767ce45f9db64ee26c6}{ADCComparatorRegionSet} (unsigned long ulBase, unsigned long ulComp, unsigned long ulLowRef, unsigned long ulHighRef)
\item 
void \hyperlink{group__adc__api_ga0544b0ef692c8f61717c3c7e7620eb4a}{ADCComparatorReset} (unsigned long ulBase, unsigned long ulComp, tBoolean bTrigger, tBoolean bInterrupt)
\item 
void \hyperlink{group__adc__api_gaffeb0d450cb43c054a066bc70883c4ba}{ADCComparatorIntDisable} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
void \hyperlink{group__adc__api_gae8039c6b0d12de1fa8e55b7d53a16293}{ADCComparatorIntEnable} (unsigned long ulBase, unsigned long ulSequenceNum)
\item 
unsigned long \hyperlink{group__adc__api_gab5529426725e33dc96f2e8b934017af3}{ADCComparatorIntStatus} (unsigned long ulBase)
\item 
void \hyperlink{group__adc__api_gac669ea52bbdd39f67d94f00dbd6fd0bd}{ADCComparatorIntClear} (unsigned long ulBase, unsigned long ulStatus)
\item 
void \hyperlink{group__adc__api_ga419594c26fdab5942be14e6d58413bf1}{ADCReferenceSet} (unsigned long ulBase, unsigned long ulRef)
\item 
unsigned long \hyperlink{group__adc__api_ga5c9075057153bc669f93906cd0462e80}{ADCReferenceGet} (unsigned long ulBase)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{group__adc__api_ga1864354227236229a298d604ed7793c0}{
\index{adc\_\-api@{adc\_\-api}!ADCComparatorConfigure@{ADCComparatorConfigure}}
\index{ADCComparatorConfigure@{ADCComparatorConfigure}!adc_api@{adc\_\-api}}
\subsubsection[{ADCComparatorConfigure}]{\setlength{\rightskip}{0pt plus 5cm}void ADCComparatorConfigure (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulComp, }
\item[{unsigned long}]{ ulConfig}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga1864354227236229a298d604ed7793c0}
Configures an ADC digital comparator.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulComp}]is the index of the comparator to configure. \item[{\em ulConfig}]is the configuration of the comparator.\end{DoxyParams}
This function will configure a comparator. The {\itshape ulConfig\/} parameter is the result of a logical OR operation between the {\bfseries ADC\_\-COMP\_\-TRIG\_\-xxx}, and {\bfseries ADC\_\-COMP\_\-INT\_\-xxx} values.

The {\bfseries ADC\_\-COMP\_\-TRIG\_\-xxx} term can take on the following values:


\begin{DoxyItemize}
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-NONE} to never trigger PWM fault condition.
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-LOW\_\-ALWAYS} to always trigger PWM fault condition when ADC output is in the low-\/band.
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-LOW\_\-ONCE} to trigger PWM fault condition once when ADC output transitions into the low-\/band.
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-LOW\_\-HALWAYS} to always trigger PWM fault condition when ADC output is in the low-\/band only if ADC output has been in the high-\/band since the last trigger output.
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-LOW\_\-HONCE} to trigger PWM fault condition once when ADC output transitions into low-\/band only if ADC output has been in the high-\/band since the last trigger output.
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-MID\_\-ALWAYS} to always trigger PWM fault condition when ADC output is in the mid-\/band.
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-MID\_\-ONCE} to trigger PWM fault condition once when ADC output transitions into the mid-\/band.
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-HIGH\_\-ALWAYS} to always trigger PWM fault condition when ADC output is in the high-\/band.
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-HIGH\_\-ONCE} to trigger PWM fault condition once when ADC output transitions into the high-\/band.
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-HIGH\_\-HALWAYS} to always trigger PWM fault condition when ADC output is in the high-\/band only if ADC output has been in the low-\/band since the last trigger output.
\item {\bfseries ADC\_\-COMP\_\-TRIG\_\-HIGH\_\-HONCE} to trigger PWM fault condition once when ADC output transitions into high-\/band only if ADC output has been in the low-\/band since the last trigger output.
\end{DoxyItemize}

The {\bfseries ADC\_\-COMP\_\-INT\_\-xxx} term can take on the following values:


\begin{DoxyItemize}
\item {\bfseries ADC\_\-COMP\_\-INT\_\-NONE} to never generate ADC interrupt.
\item {\bfseries ADC\_\-COMP\_\-INT\_\-LOW\_\-ALWAYS} to always generate ADC interrupt when ADC output is in the low-\/band.
\item {\bfseries ADC\_\-COMP\_\-INT\_\-LOW\_\-ONCE} to generate ADC interrupt once when ADC output transitions into the low-\/band.
\item {\bfseries ADC\_\-COMP\_\-\_\-INT\_\-LOW\_\-HALWAYS} to always generate ADC interrupt when ADC output is in the low-\/band only if ADC output has been in the high-\/band since the last trigger output.
\item {\bfseries ADC\_\-COMP\_\-INT\_\-LOW\_\-HONCE} to generate ADC interrupt once when ADC output transitions into low-\/band only if ADC output has been in the high-\/band since the last trigger output.
\item {\bfseries ADC\_\-COMP\_\-INT\_\-MID\_\-ALWAYS} to always generate ADC interrupt when ADC output is in the mid-\/band.
\item {\bfseries ADC\_\-COMP\_\-INT\_\-MID\_\-ONCE} to generate ADC interrupt once when ADC output transitions into the mid-\/band.
\item {\bfseries ADC\_\-COMP\_\-INT\_\-HIGH\_\-ALWAYS} to always generate ADC interrupt when ADC output is in the high-\/band.
\item {\bfseries ADC\_\-COMP\_\-INT\_\-HIGH\_\-ONCE} to generate ADC interrupt once when ADC output transitions into the high-\/band.
\item {\bfseries ADC\_\-COMP\_\-INT\_\-HIGH\_\-HALWAYS} to always generate ADC interrupt when ADC output is in the high-\/band only if ADC output has been in the low-\/band since the last trigger output.
\item {\bfseries ADC\_\-COMP\_\-INT\_\-HIGH\_\-HONCE} to generate ADC interrupt once when ADC output transitions into high-\/band only if ADC output has been in the low-\/band since the last trigger output.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gac669ea52bbdd39f67d94f00dbd6fd0bd}{
\index{adc\_\-api@{adc\_\-api}!ADCComparatorIntClear@{ADCComparatorIntClear}}
\index{ADCComparatorIntClear@{ADCComparatorIntClear}!adc_api@{adc\_\-api}}
\subsubsection[{ADCComparatorIntClear}]{\setlength{\rightskip}{0pt plus 5cm}void ADCComparatorIntClear (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulStatus}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gac669ea52bbdd39f67d94f00dbd6fd0bd}
Clears sample sequence comparator interrupt source.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulStatus}]is the bit-\/mapped interrupts status to clear.\end{DoxyParams}
The specified interrupt status is cleared.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gaffeb0d450cb43c054a066bc70883c4ba}{
\index{adc\_\-api@{adc\_\-api}!ADCComparatorIntDisable@{ADCComparatorIntDisable}}
\index{ADCComparatorIntDisable@{ADCComparatorIntDisable}!adc_api@{adc\_\-api}}
\subsubsection[{ADCComparatorIntDisable}]{\setlength{\rightskip}{0pt plus 5cm}void ADCComparatorIntDisable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gaffeb0d450cb43c054a066bc70883c4ba}
Disables a sample sequence comparator interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
This function disables the requested sample sequence comparator interrupt.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gae8039c6b0d12de1fa8e55b7d53a16293}{
\index{adc\_\-api@{adc\_\-api}!ADCComparatorIntEnable@{ADCComparatorIntEnable}}
\index{ADCComparatorIntEnable@{ADCComparatorIntEnable}!adc_api@{adc\_\-api}}
\subsubsection[{ADCComparatorIntEnable}]{\setlength{\rightskip}{0pt plus 5cm}void ADCComparatorIntEnable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gae8039c6b0d12de1fa8e55b7d53a16293}
Enables a sample sequence comparator interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
This function enables the requested sample sequence comparator interrupt.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gab5529426725e33dc96f2e8b934017af3}{
\index{adc\_\-api@{adc\_\-api}!ADCComparatorIntStatus@{ADCComparatorIntStatus}}
\index{ADCComparatorIntStatus@{ADCComparatorIntStatus}!adc_api@{adc\_\-api}}
\subsubsection[{ADCComparatorIntStatus}]{\setlength{\rightskip}{0pt plus 5cm}unsigned long ADCComparatorIntStatus (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gab5529426725e33dc96f2e8b934017af3}
Gets the current comparator interrupt status.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module.\end{DoxyParams}
This returns the digitial comparator interrupt status bits. This status is sequence agnostic.

\begin{DoxyReturn}{Returns}
The current comparator interrupt status. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gab175455ea8292767ce45f9db64ee26c6}{
\index{adc\_\-api@{adc\_\-api}!ADCComparatorRegionSet@{ADCComparatorRegionSet}}
\index{ADCComparatorRegionSet@{ADCComparatorRegionSet}!adc_api@{adc\_\-api}}
\subsubsection[{ADCComparatorRegionSet}]{\setlength{\rightskip}{0pt plus 5cm}void ADCComparatorRegionSet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulComp, }
\item[{unsigned long}]{ ulLowRef, }
\item[{unsigned long}]{ ulHighRef}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gab175455ea8292767ce45f9db64ee26c6}
Defines the ADC digital comparator regions.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulComp}]is the index of the comparator to configure. \item[{\em ulLowRef}]is the reference point for the low/mid band threshold. \item[{\em ulHighRef}]is the reference point for the mid/high band threshold.\end{DoxyParams}
The ADC digital comparator operation is based on three ADC value regions:
\begin{DoxyItemize}
\item {\bfseries low-\/band} is defined as any ADC value less than or equal to the {\itshape ulLowRef\/} value.
\item {\bfseries mid-\/band} is defined as any ADC value greater than the {\itshape ulLowRef\/} value but less than or equal to the {\itshape ulHighRef\/} value.
\item {\bfseries high-\/band} is defined as any ADC value greater than the {\itshape ulHighRef\/} value.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga0544b0ef692c8f61717c3c7e7620eb4a}{
\index{adc\_\-api@{adc\_\-api}!ADCComparatorReset@{ADCComparatorReset}}
\index{ADCComparatorReset@{ADCComparatorReset}!adc_api@{adc\_\-api}}
\subsubsection[{ADCComparatorReset}]{\setlength{\rightskip}{0pt plus 5cm}void ADCComparatorReset (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulComp, }
\item[{tBoolean}]{ bTrigger, }
\item[{tBoolean}]{ bInterrupt}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga0544b0ef692c8f61717c3c7e7620eb4a}
Resets the current ADC digital comparator conditions.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulComp}]is the index of the comparator. \item[{\em bTrigger}]is the flag to indicate reset of Trigger conditions. \item[{\em bInterrupt}]is the flag to indicate reset of Interrupt conditions.\end{DoxyParams}
Because the digital comparator uses current and previous ADC values, this function is provide to allow the comparator to be reset to its initial value to prevent stale data from being used when a sequence is enabled.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gafbe28f42c1d53ca93d1d78dabdce3511}{
\index{adc\_\-api@{adc\_\-api}!ADCHardwareOversampleConfigure@{ADCHardwareOversampleConfigure}}
\index{ADCHardwareOversampleConfigure@{ADCHardwareOversampleConfigure}!adc_api@{adc\_\-api}}
\subsubsection[{ADCHardwareOversampleConfigure}]{\setlength{\rightskip}{0pt plus 5cm}void ADCHardwareOversampleConfigure (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulFactor}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gafbe28f42c1d53ca93d1d78dabdce3511}
Configures the hardware oversampling factor of the ADC.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulFactor}]is the number of samples to be averaged.\end{DoxyParams}
This function configures the hardware oversampling for the ADC, which can be used to provide better resolution on the sampled data. Oversampling is accomplished by averaging multiple samples from the same analog input. Six different oversampling rates are supported; 2x, 4x, 8x, 16x, 32x, and 64x. Specifying an oversampling factor of zero will disable hardware oversampling.

Hardware oversampling applies uniformly to all sample sequencers. It does not reduce the depth of the sample sequencers like the software oversampling APIs; each sample written into the sample sequence FIFO is a fully oversampled analog input reading.

Enabling hardware averaging increases the precision of the ADC at the cost of throughput. For example, enabling 4x oversampling reduces the throughput of a 250 Ksps ADC to 62.5 Ksps.

\begin{DoxyNote}{Note}
Hardware oversampling is available beginning with Rev C0 of the Stellaris microcontroller.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gae80ad35fe9d9e4119df22142e2ddeab1}{
\index{adc\_\-api@{adc\_\-api}!ADCIntClear@{ADCIntClear}}
\index{ADCIntClear@{ADCIntClear}!adc_api@{adc\_\-api}}
\subsubsection[{ADCIntClear}]{\setlength{\rightskip}{0pt plus 5cm}void ADCIntClear (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gae80ad35fe9d9e4119df22142e2ddeab1}
Clears sample sequence interrupt source.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
The specified sample sequence interrupt is cleared, so that it no longer asserts. This must be done in the interrupt handler to keep it from being called again immediately upon exit.

\begin{DoxyNote}{Note}
Since there is a write buffer in the Cortex-\/M3 processor, it may take several clock cycles before the interrupt source is actually cleared. Therefore, it is recommended that the interrupt source be cleared early in the interrupt handler (as opposed to the very last action) to avoid returning from the interrupt handler before the interrupt source is actually cleared. Failure to do so may result in the interrupt handler being immediately reentered (since NVIC still sees the interrupt source asserted).
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gabbafafc5d13dab892fc2f09c2b366c08}{
\index{adc\_\-api@{adc\_\-api}!ADCIntDisable@{ADCIntDisable}}
\index{ADCIntDisable@{ADCIntDisable}!adc_api@{adc\_\-api}}
\subsubsection[{ADCIntDisable}]{\setlength{\rightskip}{0pt plus 5cm}void ADCIntDisable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gabbafafc5d13dab892fc2f09c2b366c08}
Disables a sample sequence interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
This function disables the requested sample sequence interrupt.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga983b3c3086985150a5498df181c3d3c6}{
\index{adc\_\-api@{adc\_\-api}!ADCIntEnable@{ADCIntEnable}}
\index{ADCIntEnable@{ADCIntEnable}!adc_api@{adc\_\-api}}
\subsubsection[{ADCIntEnable}]{\setlength{\rightskip}{0pt plus 5cm}void ADCIntEnable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga983b3c3086985150a5498df181c3d3c6}
Enables a sample sequence interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
This function enables the requested sample sequence interrupt. Any outstanding interrupts are cleared before enabling the sample sequence interrupt.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga90b697e93737637b18ca17ba315d0960}{
\index{adc\_\-api@{adc\_\-api}!ADCIntRegister@{ADCIntRegister}}
\index{ADCIntRegister@{ADCIntRegister}!adc_api@{adc\_\-api}}
\subsubsection[{ADCIntRegister}]{\setlength{\rightskip}{0pt plus 5cm}void ADCIntRegister (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum, }
\item[{void($\ast$)(void)}]{ pfnHandler}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga90b697e93737637b18ca17ba315d0960}
Registers an interrupt handler for an ADC interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number. \item[{\em pfnHandler}]is a pointer to the function to be called when the ADC sample sequence interrupt occurs.\end{DoxyParams}
This function sets the handler to be called when a sample sequence interrupt occurs. This will enable the global interrupt in the interrupt controller; the sequence interrupt must be enabled with \hyperlink{group__adc__api_ga983b3c3086985150a5498df181c3d3c6}{ADCIntEnable()}. It is the interrupt handler's responsibility to clear the interrupt source via \hyperlink{group__adc__api_gae80ad35fe9d9e4119df22142e2ddeab1}{ADCIntClear()}.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__interrupt__api_ga471d00d73ae22faa426c202f608e9c69}{IntRegister()} for important information about registering interrupt handlers.
\end{DoxySeeAlso}
\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga3900a49a9497d231648740508481c92c}{
\index{adc\_\-api@{adc\_\-api}!ADCIntStatus@{ADCIntStatus}}
\index{ADCIntStatus@{ADCIntStatus}!adc_api@{adc\_\-api}}
\subsubsection[{ADCIntStatus}]{\setlength{\rightskip}{0pt plus 5cm}unsigned long ADCIntStatus (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum, }
\item[{tBoolean}]{ bMasked}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga3900a49a9497d231648740508481c92c}
Gets the current interrupt status.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number. \item[{\em bMasked}]is false if the raw interrupt status is required and true if the masked interrupt status is required.\end{DoxyParams}
This returns the interrupt status for the specified sample sequence. Either the raw interrupt status or the status of interrupts that are allowed to reflect to the processor can be returned.

\begin{DoxyReturn}{Returns}
The current raw or masked interrupt status. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga0130fdd06a388f91d68b42e98599405c}{
\index{adc\_\-api@{adc\_\-api}!ADCIntUnregister@{ADCIntUnregister}}
\index{ADCIntUnregister@{ADCIntUnregister}!adc_api@{adc\_\-api}}
\subsubsection[{ADCIntUnregister}]{\setlength{\rightskip}{0pt plus 5cm}void ADCIntUnregister (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga0130fdd06a388f91d68b42e98599405c}
Unregisters the interrupt handler for an ADC interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
This function unregisters the interrupt handler. This will disable the global interrupt in the interrupt controller; the sequence interrupt must be disabled via \hyperlink{group__adc__api_gabbafafc5d13dab892fc2f09c2b366c08}{ADCIntDisable()}.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__interrupt__api_ga471d00d73ae22faa426c202f608e9c69}{IntRegister()} for important information about registering interrupt handlers.
\end{DoxySeeAlso}
\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gad967d1980e0f58c59dd8a150737e7bef}{
\index{adc\_\-api@{adc\_\-api}!ADCProcessorTrigger@{ADCProcessorTrigger}}
\index{ADCProcessorTrigger@{ADCProcessorTrigger}!adc_api@{adc\_\-api}}
\subsubsection[{ADCProcessorTrigger}]{\setlength{\rightskip}{0pt plus 5cm}void ADCProcessorTrigger (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gad967d1980e0f58c59dd8a150737e7bef}
Causes a processor trigger for a sample sequence.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
This function triggers a processor-\/initiated sample sequence if the sample sequence trigger is configured to {\bfseries ADC\_\-TRIGGER\_\-PROCESSOR}.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga5c9075057153bc669f93906cd0462e80}{
\index{adc\_\-api@{adc\_\-api}!ADCReferenceGet@{ADCReferenceGet}}
\index{ADCReferenceGet@{ADCReferenceGet}!adc_api@{adc\_\-api}}
\subsubsection[{ADCReferenceGet}]{\setlength{\rightskip}{0pt plus 5cm}unsigned long ADCReferenceGet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga5c9075057153bc669f93906cd0462e80}
Returns the current setting of the ADC reference.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module.\end{DoxyParams}
Returns the value of the ADC reference setting. The returned value will be one of {\bfseries ADC\_\-REF\_\-INT} or {\bfseries ADC\_\-REF\_\-EXT\_\-3V}.

\begin{DoxyNote}{Note}
The value returned by this function is only meaningful if used on a part that is capable of using an external reference. Consult the data sheet for your part to determine if it has an external reference input.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
The current setting of the ADC reference. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga419594c26fdab5942be14e6d58413bf1}{
\index{adc\_\-api@{adc\_\-api}!ADCReferenceSet@{ADCReferenceSet}}
\index{ADCReferenceSet@{ADCReferenceSet}!adc_api@{adc\_\-api}}
\subsubsection[{ADCReferenceSet}]{\setlength{\rightskip}{0pt plus 5cm}void ADCReferenceSet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulRef}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga419594c26fdab5942be14e6d58413bf1}
Selects the ADC reference.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulRef}]is the reference to use.\end{DoxyParams}
The ADC reference is set as specified by {\itshape ulRef\/}. It must be one of {\bfseries ADC\_\-REF\_\-INT} or {\bfseries ADC\_\-REF\_\-EXT\_\-3V}, for internal or external reference. If {\bfseries ADC\_\-REF\_\-INT} is chosen, then an internal 3V reference is used and no external reference is needed. If {\bfseries ADC\_\-REF\_\-EXT\_\-3V} is chosen, then a 3V reference must be supplied to the AVREF pin.

\begin{DoxyNote}{Note}
The ADC reference can only be selected on parts that have an external reference. Consult the data sheet for your part to determine if there is an external reference.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga66699c796f6252a31113a01ef56ddcd7}{
\index{adc\_\-api@{adc\_\-api}!ADCSequenceConfigure@{ADCSequenceConfigure}}
\index{ADCSequenceConfigure@{ADCSequenceConfigure}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSequenceConfigure}]{\setlength{\rightskip}{0pt plus 5cm}void ADCSequenceConfigure (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum, }
\item[{unsigned long}]{ ulTrigger, }
\item[{unsigned long}]{ ulPriority}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga66699c796f6252a31113a01ef56ddcd7}
Configures the trigger source and priority of a sample sequence.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number. \item[{\em ulTrigger}]is the trigger source that initiates the sample sequence; must be one of the {\bfseries ADC\_\-TRIGGER\_\-$\ast$} values. \item[{\em ulPriority}]is the relative priority of the sample sequence with respect to the other sample sequences.\end{DoxyParams}
This function configures the initiation criteria for a sample sequence. Valid sample sequences range from zero to three; sequence zero will capture up to eight samples, sequences one and two will capture up to four samples, and sequence three will capture a single sample. The trigger condition and priority (with respect to other sample sequence execution) is set.

The {\itshape ulTrigger\/} parameter can take on the following values:


\begin{DoxyItemize}
\item {\bfseries ADC\_\-TRIGGER\_\-PROCESSOR} -\/ A trigger generated by the processor, via the \hyperlink{group__adc__api_gad967d1980e0f58c59dd8a150737e7bef}{ADCProcessorTrigger()} function.
\item {\bfseries ADC\_\-TRIGGER\_\-COMP0} -\/ A trigger generated by the first analog comparator; configured with \hyperlink{group__comp__api_ga83076c7c7904a1bbc4e335c6b973c090}{ComparatorConfigure()}.
\item {\bfseries ADC\_\-TRIGGER\_\-COMP1} -\/ A trigger generated by the second analog comparator; configured with \hyperlink{group__comp__api_ga83076c7c7904a1bbc4e335c6b973c090}{ComparatorConfigure()}.
\item {\bfseries ADC\_\-TRIGGER\_\-COMP2} -\/ A trigger generated by the third analog comparator; configured with \hyperlink{group__comp__api_ga83076c7c7904a1bbc4e335c6b973c090}{ComparatorConfigure()}.
\item {\bfseries ADC\_\-TRIGGER\_\-EXTERNAL} -\/ A trigger generated by an input from the Port B4 pin.
\item {\bfseries ADC\_\-TRIGGER\_\-TIMER} -\/ A trigger generated by a timer; configured with \hyperlink{group__timer__api_gae1552db4e66ccf599748b7adaa4fbd21}{TimerControlTrigger()}.
\item {\bfseries ADC\_\-TRIGGER\_\-PWM0} -\/ A trigger generated by the first PWM generator; configured with \hyperlink{group__pwm__api_gabc630912b7464202f0cf4eb17219583e}{PWMGenIntTrigEnable()}.
\item {\bfseries ADC\_\-TRIGGER\_\-PWM1} -\/ A trigger generated by the second PWM generator; configured with \hyperlink{group__pwm__api_gabc630912b7464202f0cf4eb17219583e}{PWMGenIntTrigEnable()}.
\item {\bfseries ADC\_\-TRIGGER\_\-PWM2} -\/ A trigger generated by the third PWM generator; configured with \hyperlink{group__pwm__api_gabc630912b7464202f0cf4eb17219583e}{PWMGenIntTrigEnable()}.
\item {\bfseries ADC\_\-TRIGGER\_\-PWM3} -\/ A trigger generated by the fourth PWM generator; configured with \hyperlink{group__pwm__api_gabc630912b7464202f0cf4eb17219583e}{PWMGenIntTrigEnable()}.
\item {\bfseries ADC\_\-TRIGGER\_\-ALWAYS} -\/ A trigger that is always asserted, causing the sample sequence to capture repeatedly (so long as there is not a higher priority source active).
\end{DoxyItemize}

Note that not all trigger sources are available on all Stellaris family members; consult the data sheet for the device in question to determine the availability of triggers.

The {\itshape ulPriority\/} parameter is a value between 0 and 3, where 0 represents the highest priority and 3 the lowest. Note that when programming the priority among a set of sample sequences, each must have unique priority; it is up to the caller to guarantee the uniqueness of the priorities.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga6e0219d881315c4b39e5686f40aa0db7}{
\index{adc\_\-api@{adc\_\-api}!ADCSequenceDataGet@{ADCSequenceDataGet}}
\index{ADCSequenceDataGet@{ADCSequenceDataGet}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSequenceDataGet}]{\setlength{\rightskip}{0pt plus 5cm}long ADCSequenceDataGet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum, }
\item[{unsigned long $\ast$}]{ pulBuffer}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga6e0219d881315c4b39e5686f40aa0db7}
Gets the captured data for a sample sequence.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number. \item[{\em pulBuffer}]is the address where the data is stored.\end{DoxyParams}
This function copies data from the specified sample sequence output FIFO to a memory resident buffer. The number of samples available in the hardware FIFO are copied into the buffer, which is assumed to be large enough to hold that many samples. This will only return the samples that are presently available, which may not be the entire sample sequence if it is in the process of being executed.

\begin{DoxyReturn}{Returns}
Returns the number of samples copied to the buffer. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga87047180c884c67e38fc95c9f0e5bdb6}{
\index{adc\_\-api@{adc\_\-api}!ADCSequenceDisable@{ADCSequenceDisable}}
\index{ADCSequenceDisable@{ADCSequenceDisable}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSequenceDisable}]{\setlength{\rightskip}{0pt plus 5cm}void ADCSequenceDisable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga87047180c884c67e38fc95c9f0e5bdb6}
Disables a sample sequence.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
Prevents the specified sample sequence from being captured when its trigger is detected. A sample sequence should be disabled before it is configured.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga79b1adfafb8f25fc88613156ab1ef9ae}{
\index{adc\_\-api@{adc\_\-api}!ADCSequenceEnable@{ADCSequenceEnable}}
\index{ADCSequenceEnable@{ADCSequenceEnable}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSequenceEnable}]{\setlength{\rightskip}{0pt plus 5cm}void ADCSequenceEnable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga79b1adfafb8f25fc88613156ab1ef9ae}
Enables a sample sequence.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
Allows the specified sample sequence to be captured when its trigger is detected. A sample sequence must be configured before it is enabled.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga8b785e96d8b5adecf41a90f3bff38f1b}{
\index{adc\_\-api@{adc\_\-api}!ADCSequenceOverflow@{ADCSequenceOverflow}}
\index{ADCSequenceOverflow@{ADCSequenceOverflow}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSequenceOverflow}]{\setlength{\rightskip}{0pt plus 5cm}long ADCSequenceOverflow (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga8b785e96d8b5adecf41a90f3bff38f1b}
Determines if a sample sequence overflow occurred.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
This determines if a sample sequence overflow has occurred. This will happen if the captured samples are not read from the FIFO before the next trigger occurs.

\begin{DoxyReturn}{Returns}
Returns zero if there was not an overflow, and non-\/zero if there was. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga83f78e68fc287cf7c36a171c54389ef6}{
\index{adc\_\-api@{adc\_\-api}!ADCSequenceOverflowClear@{ADCSequenceOverflowClear}}
\index{ADCSequenceOverflowClear@{ADCSequenceOverflowClear}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSequenceOverflowClear}]{\setlength{\rightskip}{0pt plus 5cm}void ADCSequenceOverflowClear (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga83f78e68fc287cf7c36a171c54389ef6}
Clears the overflow condition on a sample sequence.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
This will clear an overflow condition on one of the sample sequences. The overflow condition must be cleared in order to detect a subsequent overflow condition (it otherwise causes no harm).

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga4255381a49e2767945734a15adb700ce}{
\index{adc\_\-api@{adc\_\-api}!ADCSequenceStepConfigure@{ADCSequenceStepConfigure}}
\index{ADCSequenceStepConfigure@{ADCSequenceStepConfigure}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSequenceStepConfigure}]{\setlength{\rightskip}{0pt plus 5cm}void ADCSequenceStepConfigure (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum, }
\item[{unsigned long}]{ ulStep, }
\item[{unsigned long}]{ ulConfig}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga4255381a49e2767945734a15adb700ce}
Configure a step of the sample sequencer.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number. \item[{\em ulStep}]is the step to be configured. \item[{\em ulConfig}]is the configuration of this step; must be a logical OR of {\bfseries ADC\_\-CTL\_\-TS}, {\bfseries ADC\_\-CTL\_\-IE}, {\bfseries ADC\_\-CTL\_\-END}, {\bfseries ADC\_\-CTL\_\-D}, and one of the input channel selects ({\bfseries ADC\_\-CTL\_\-CH0} through {\bfseries ADC\_\-CTL\_\-CH15}). For parts with the digital comparator feature, the follow values may also be OR'd into the {\itshape ulConfig\/} value to enable the digital comparater feature: {\bfseries ADC\_\-CTL\_\-CE} and one of the comparater selects ({\bfseries ADC\_\-CTL\_\-CMP0} through {\bfseries ADC\_\-CTL\_\-CMP7}).\end{DoxyParams}
This function will set the configuration of the ADC for one step of a sample sequence. The ADC can be configured for single-\/ended or differential operation (the {\bfseries ADC\_\-CTL\_\-D} bit selects differential operation when set), the channel to be sampled can be chosen (the {\bfseries ADC\_\-CTL\_\-CH0} through {\bfseries ADC\_\-CTL\_\-CH15} values), and the internal temperature sensor can be selected (the {\bfseries ADC\_\-CTL\_\-TS} bit). Additionally, this step can be defined as the last in the sequence (the {\bfseries ADC\_\-CTL\_\-END} bit) and it can be configured to cause an interrupt when the step is complete (the {\bfseries ADC\_\-CTL\_\-IE} bit). If the digital comparators are present on the device, this step may also be configured send the ADC sample to the selected comparator (the {\bfseries ADC\_\-CTL\_\-CMP0} through {\bfseries ADC\_\-CTL\_\-CMP7} values) by using the {\bfseries ADC\_\-CTL\_\-CE} bit. The configuration is used by the ADC at the appropriate time when the trigger for this sequence occurs.

\begin{DoxyNote}{Note}
If the Digitial Comparator is present and enabled using the {\bfseries ADC\_\-CTL\_\-CE} bit, the ADC sample will NOT be written into the ADC sequence data FIFO.
\end{DoxyNote}
The {\itshape ulStep\/} parameter determines the order in which the samples are captured by the ADC when the trigger occurs. It can range from zero to seven for the first sample sequence, from zero to three for the second and third sample sequence, and can only be zero for the fourth sample sequence.

Differential mode only works with adjacent channel pairs (for example, 0 and 1). The channel select must be the number of the channel pair to sample (for example, {\bfseries ADC\_\-CTL\_\-CH0} for 0 and 1, or {\bfseries ADC\_\-CTL\_\-CH1} for 2 and 3) or undefined results will be returned by the ADC. Additionally, if differential mode is selected when the temperature sensor is being sampled, undefined results will be returned by the ADC.

It is the responsibility of the caller to ensure that a valid configuration is specified; this function does not check the validity of the specified configuration.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga5a2c01642708999b5008bce9fb21d0d5}{
\index{adc\_\-api@{adc\_\-api}!ADCSequenceUnderflow@{ADCSequenceUnderflow}}
\index{ADCSequenceUnderflow@{ADCSequenceUnderflow}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSequenceUnderflow}]{\setlength{\rightskip}{0pt plus 5cm}long ADCSequenceUnderflow (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga5a2c01642708999b5008bce9fb21d0d5}
Determines if a sample sequence underflow occurred.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
This determines if a sample sequence underflow has occurred. This will happen if too many samples are read from the FIFO.

\begin{DoxyReturn}{Returns}
Returns zero if there was not an underflow, and non-\/zero if there was. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gab1fe3dc72fdfc14c10e611c938b8ae6c}{
\index{adc\_\-api@{adc\_\-api}!ADCSequenceUnderflowClear@{ADCSequenceUnderflowClear}}
\index{ADCSequenceUnderflowClear@{ADCSequenceUnderflowClear}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSequenceUnderflowClear}]{\setlength{\rightskip}{0pt plus 5cm}void ADCSequenceUnderflowClear (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gab1fe3dc72fdfc14c10e611c938b8ae6c}
Clears the underflow condition on a sample sequence.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number.\end{DoxyParams}
This will clear an underflow condition on one of the sample sequences. The underflow condition must be cleared in order to detect a subsequent underflow condition (it otherwise causes no harm).

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gaa637ac7dcf88b706e7a8a0a8c33fa32c}{
\index{adc\_\-api@{adc\_\-api}!ADCSoftwareOversampleConfigure@{ADCSoftwareOversampleConfigure}}
\index{ADCSoftwareOversampleConfigure@{ADCSoftwareOversampleConfigure}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSoftwareOversampleConfigure}]{\setlength{\rightskip}{0pt plus 5cm}void ADCSoftwareOversampleConfigure (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum, }
\item[{unsigned long}]{ ulFactor}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gaa637ac7dcf88b706e7a8a0a8c33fa32c}
Configures the software oversampling factor of the ADC.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number. \item[{\em ulFactor}]is the number of samples to be averaged.\end{DoxyParams}
This function configures the software oversampling for the ADC, which can be used to provide better resolution on the sampled data. Oversampling is accomplished by averaging multiple samples from the same analog input. Three different oversampling rates are supported; 2x, 4x, and 8x.

Oversampling is only supported on the sample sequencers that are more than one sample in depth (that is, the fourth sample sequencer is not supported). Oversampling by 2x (for example) divides the depth of the sample sequencer by two; so 2x oversampling on the first sample sequencer can only provide four samples per trigger. This also means that 8x oversampling is only available on the first sample sequencer.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_gaebfb19a94337c291be9e88f7fbfb36a7}{
\index{adc\_\-api@{adc\_\-api}!ADCSoftwareOversampleDataGet@{ADCSoftwareOversampleDataGet}}
\index{ADCSoftwareOversampleDataGet@{ADCSoftwareOversampleDataGet}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSoftwareOversampleDataGet}]{\setlength{\rightskip}{0pt plus 5cm}void ADCSoftwareOversampleDataGet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum, }
\item[{unsigned long $\ast$}]{ pulBuffer, }
\item[{unsigned long}]{ ulCount}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_gaebfb19a94337c291be9e88f7fbfb36a7}
Gets the captured data for a sample sequence using software oversampling.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number. \item[{\em pulBuffer}]is the address where the data is stored. \item[{\em ulCount}]is the number of samples to be read.\end{DoxyParams}
This function copies data from the specified sample sequence output FIFO to a memory resident buffer with software oversampling applied. The requested number of samples are copied into the data buffer; if there are not enough samples in the hardware FIFO to satisfy this many oversampled data items then incorrect results will be returned. It is the caller's responsibility to read only the samples that are available and wait until enough data is available, for example as a result of receiving an interrupt.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__adc__api_ga6d0d2422800b86bae349a98913d9834b}{
\index{adc\_\-api@{adc\_\-api}!ADCSoftwareOversampleStepConfigure@{ADCSoftwareOversampleStepConfigure}}
\index{ADCSoftwareOversampleStepConfigure@{ADCSoftwareOversampleStepConfigure}!adc_api@{adc\_\-api}}
\subsubsection[{ADCSoftwareOversampleStepConfigure}]{\setlength{\rightskip}{0pt plus 5cm}void ADCSoftwareOversampleStepConfigure (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSequenceNum, }
\item[{unsigned long}]{ ulStep, }
\item[{unsigned long}]{ ulConfig}
\end{DoxyParamCaption}
)}}
\label{group__adc__api_ga6d0d2422800b86bae349a98913d9834b}
Configures a step of the software oversampled sequencer.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the ADC module. \item[{\em ulSequenceNum}]is the sample sequence number. \item[{\em ulStep}]is the step to be configured. \item[{\em ulConfig}]is the configuration of this step.\end{DoxyParams}
This function configures a step of the sample sequencer when using the software oversampling feature. The number of steps available depends on the oversampling factor set by \hyperlink{group__adc__api_gaa637ac7dcf88b706e7a8a0a8c33fa32c}{ADCSoftwareOversampleConfigure()}. The value of {\itshape ulConfig\/} is the same as defined for \hyperlink{group__adc__api_ga4255381a49e2767945734a15adb700ce}{ADCSequenceStepConfigure()}.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
